<?php

namespace app\admin\controller;
use app\BaseController;
use GuzzleHttp\Client;
use QL\QueryList;

class Reptile extends BaseController
{
    /**
     * https://coserlab.io/
     * Cosplay[179]
     * 写真[125]
     */
    public function coserlab() {
        $client = new Client([
            'verify' => false
        ]);
        $page = $this->request->get('page');
        $result = $client->request('GET','https://coserlab.io/wp-json/wp/v2/posts?categories=1&per_page=10&page='.$page);
        $result = json_decode($result->getBody()->getContents(),true);
        return result()->success($result);
    }
    /**
     * https://www.tujigu.top/
     * Cosplay[179]
     * 写真[125]
     */
    public function tujigu() {
        $html = file_get_contents('https://www.tujigu.top/');
        $data = QueryList::Query($html,[
            'href' => ['.row>.text-center->a','href']
        ])->getData(function($item){
            return $item;
        });

        print_r($data);
    }
}